

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>rbd-nbd – 把 rbd 镜像映射为 nbd 设备 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="rbd-ggate – 通过 FreeBSD GEOM 网关映射 rbd 映像" href="../rbd-ggate/" />
    <link rel="prev" title="rbd-fuse – 把 rbd 映像展现为文件" href="../rbd-fuse/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../../rbd/">Ceph 块设备</a> &raquo;</li>
        
          <li><a href="../../../rbd/man/">Ceph 块设备手册页</a> &raquo;</li>
        
      <li>rbd-nbd – 把 rbd 镜像映射为 nbd 设备</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/man/8/rbd-nbd.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../rbd/rados-rbd-cmds/">基本命令</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rbd/rbd-operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rbd/rbd-integrations/">对接</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../rbd/man/">手册页</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../rbd/">rbd</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-fuse/">rbd-fuse</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">rbd-nbd</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">提纲</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">描述</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">映像名和快照名规则</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">使用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-ggate/">rbd-ggate</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbdmap/">rbd-map</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-rbdnamer/">ceph-rbdnamer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-replay-prep/">rbd-replay-prep</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-replay/">rbd-replay</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rbd-replay-many/">rbd-replay-many</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../rbd/api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="rbd-nbd-rbd-nbd">
<h1>rbd-nbd – 把 rbd 镜像映射为 nbd 设备<a class="headerlink" href="#rbd-nbd-rbd-nbd" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<div class="line-block">
<div class="line"><strong>rbd-nbd</strong> [-c conf] [–read-only] [–device <em>nbd device</em>] [–nbds_max <em>limit</em>] [–max_part <em>limit</em>] [–exclusive] [–notrim] [–encryption-format <em>format</em>] [–encryption-passphrase-file <em>passphrase-file</em>] [–io-timeout <em>seconds</em>] [–reattach-timeout <em>seconds</em>] map <em>image-spec</em> | <em>snap-spec</em></div>
<div class="line"><strong>rbd-nbd</strong> unmap <em>nbd device</em> | <em>image-spec</em> | <em>snap-spec</em></div>
<div class="line"><strong>rbd-nbd</strong> list-mapped</div>
<div class="line"><strong>rbd-nbd</strong> attach –device <em>nbd device</em> <em>image-spec</em> | <em>snap-spec</em></div>
<div class="line"><strong>rbd-nbd</strong> detach <em>nbd device</em> | <em>image-spec</em> | <em>snap-spec</em></div>
</div>
</div>
<div class="section" id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p><strong>rbd-nbd</strong> 是个 RADOS 块设备（ rbd ）映像的客户端，与 rbd
内核模块类似。它可以把一个 rbd 映像映射为 nbd （网络块设备）设备，这样就可以当常规的本地块设备使用了。</p>
</div>
<div class="section" id="id3">
<h2>选项<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<dl class="std option">
<dt id="cmdoption-rbd-nbd-c">
<code class="sig-name descname"><span class="pre">-c</span></code><code class="sig-prename descclassname"> <span class="pre">ceph.conf</span></code><a class="headerlink" href="#cmdoption-rbd-nbd-c" title="Permalink to this definition">¶</a></dt>
<dd><p>指定 ceph.conf 配置文件，而不是用默认的 /etc/ceph/ceph.conf
来确定启动时需要的监视器。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-read-only">
<code class="sig-name descname"><span class="pre">--read-only</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-rbd-nbd-read-only" title="Permalink to this definition">¶</a></dt>
<dd><p>以只读方式映射。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-nbds_max">
<span id="cmdoption-rbd-nbd-nbds-max"></span><code class="sig-name descname"><span class="pre">--nbds_max</span></code><code class="sig-prename descclassname"> <span class="pre">*limit*</span></code><a class="headerlink" href="#cmdoption-rbd-nbd-nbds_max" title="Permalink to this definition">¶</a></dt>
<dd><p>modprobe 载入 NBD 内核模块时覆盖其 nbds_max 参数，用于限制 nbd 设备数量。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-max_part">
<span id="cmdoption-rbd-nbd-max-part"></span><code class="sig-name descname"><span class="pre">--max_part</span></code><code class="sig-prename descclassname"> <span class="pre">*limit*</span></code><a class="headerlink" href="#cmdoption-rbd-nbd-max_part" title="Permalink to this definition">¶</a></dt>
<dd><p>覆盖（内核的）模块参数 max_part 。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-exclusive">
<code class="sig-name descname"><span class="pre">--exclusive</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-rbd-nbd-exclusive" title="Permalink to this definition">¶</a></dt>
<dd><p>禁止其它客户端写入。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-notrim">
<code class="sig-name descname"><span class="pre">--notrim</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-rbd-nbd-notrim" title="Permalink to this definition">¶</a></dt>
<dd><p>关闭 trim/discard 功能。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-encryption-format">
<code class="sig-name descname"><span class="pre">--encryption-format</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-rbd-nbd-encryption-format" title="Permalink to this definition">¶</a></dt>
<dd><p>映像加密格式。可用的有： <em>luks1</em> 、 <em>luks2</em></p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-encryption-passphrase-file">
<code class="sig-name descname"><span class="pre">--encryption-passphrase-file</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-rbd-nbd-encryption-passphrase-file" title="Permalink to this definition">¶</a></dt>
<dd><p>包含口令的文件路径，用于解锁加密的映像。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-io-timeout">
<code class="sig-name descname"><span class="pre">--io-timeout</span></code><code class="sig-prename descclassname"> <span class="pre">*seconds*</span></code><a class="headerlink" href="#cmdoption-rbd-nbd-io-timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>会覆盖设备超时值。 Linux 内核请求的默认超时时间是 30 秒。这个可选参数允许你另外指定超时时长。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-rbd-nbd-reattach-timeout">
<code class="sig-name descname"><span class="pre">--reattach-timeout</span></code><code class="sig-prename descclassname"> <span class="pre">*seconds*</span></code><a class="headerlink" href="#cmdoption-rbd-nbd-reattach-timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>旧的 rbd-nbd 进程解绑后，内核等待多久才允许新进程绑定。
默认是 30 秒。</p>
</dd></dl>

</div>
<div class="section" id="id4">
<h2>映像名和快照名规则<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<div class="line-block">
<div class="line"><em>image-spec</em> is [<em>pool-name</em>]/<em>image-name</em></div>
<div class="line"><em>snap-spec</em>  is [<em>pool-name</em>]/<em>image-name</em>&#64;<em>snap-name</em></div>
</div>
<p><em>pool-name</em> 的默认值是 “rbd” 。如果映像名里包含字符串斜杠（ / ），那就必须指定 <em>pool-name</em> 。</p>
</div>
<div class="section" id="id5">
<h2>使用范围<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p><strong>rbd-nbd</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</div>
<div class="section" id="id6">
<h2>参考<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="../rbd/"><span class="doc">rbd</span></a>(8)</p>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../rbd-ggate/" class="btn btn-neutral float-right" title="rbd-ggate – 通过 FreeBSD GEOM 网关映射 rbd 映像" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../rbd-fuse/" class="btn btn-neutral float-left" title="rbd-fuse – 把 rbd 映像展现为文件" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>